package com.zj.consumer.controller;


import com.zj.consumer.domain.Student;
import com.zj.consumer.feign.FeignConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@RequestMapping("/consumer")
public class StudentController {

    @Autowired
    private RestTemplate restTemplate;


    @Autowired
    private FeignConfig feignConfig;

    @GetMapping("/find/{name}")
    public Student get(@PathVariable String name){
        System.out.println("git");
        System.out.println(name);
    return feignConfig.getStudent("hahah");

    }
}
